#!/usr/bin/env python
# coding: utf-8

# In[1]:


import pandas as pd


# In[2]:


import numpy as np


# In[22]:


def getLevelFiveData(count, startIndex):
    data_set = []
    data_max_min = []
    c_1 = np.random.randint(0, 20, count)
    c_1_max = np.max(c_1)
    c_1_min = np.min(c_1)
    data_max_min.append([c_1_max, c_1_min])
    
    # c_2 = (np.random.randint(95, size=count) / 100)
    c_2 = (np.random.rand(count) * 10 + 0.95)
    c_2_max = np.max(c_2)
    c_2_min = np.min(c_2)
    data_max_min.append([c_2_max, c_2_min])
    
    c_3 = np.random.randint(low=80, size=count)
    c_3_max = np.max(c_3)
    c_3_min = np.min(c_3)
    data_max_min.append([c_3_max, c_3_min])
    
    c_4 = np.random.randint(low=5000, size=count)
    c_4_max = np.max(c_4)
    c_4_min = np.min(c_4)
    data_max_min.append([c_4_max, c_4_min])
    
    c_5 = np.random.randint(95, 100, count)
    c_5_max = np.max(c_5)
    c_5_min = np.min(c_5)
    data_max_min.append([c_5_max, c_5_min])
    
    c_6 = np.random.randint(95, 100, count)
    c_6_max = np.max(c_6)
    c_6_min = np.min(c_6)
    data_max_min.append([c_6_max, c_6_min])
    
    c_7 = np.random.randint(low=20, size=count)
    c_7_max = np.max(c_7)
    c_7_min = np.min(c_7)
    data_max_min.append([c_7_max, c_7_min])
    
    c_8 = np.random.randint(low=90, size=count)
    c_8_max = np.max(c_8)
    c_8_min = np.min(c_8)
    data_max_min.append([c_8_max, c_8_min])
    
    c_9 = np.random.randint(low=90, size=count)
    c_9_max = np.max(c_9)
    c_9_min = np.min(c_9)
    data_max_min.append([c_9_max, c_9_min])
    
    c_10 = np.random.randint(0, 2, count)
    c_10_max = np.max(c_10)
    c_10_min = np.min(c_10)
    data_max_min.append([c_10_max, c_10_min])
    
    c_11 = np.random.randint(low=80, size=count)
    c_11_max = np.max(c_11)
    c_11_min = np.min(c_11)
    data_max_min.append([c_11_max, c_11_min])
    
    c_12 = np.random.randint(0, 10, count)
    c_12_max = np.max(c_12)
    c_12_min = np.min(c_12)
    data_max_min.append([c_12_max, c_12_min])
    
    c_13 = np.random.randint(90, 100, count)
    c_13_max = np.max(c_13)
    c_13_min = np.min(c_13)
    data_max_min.append([c_13_max, c_13_min])
    
    c_14 = np.random.randint(0, 20, count)
    c_14_max = np.max(c_14)
    c_14_min = np.min(c_14)
    data_max_min.append([c_14_max, c_14_min])
    
    c_15 = np.random.randint(90, 100, count)
    c_15_max = np.max(c_15)
    c_15_min = np.min(c_15)
    data_max_min.append([c_15_max, c_15_min])
    
    # c_16 = np.random.randint(0.7, size=count, dtype=np.float32)
    c_16 = (np.random.rand(count) * 10 + 0.7) 
    c_16_max = np.max(c_16)
    c_16_min = np.min(c_16)
    data_max_min.append([c_16_max, c_16_min])
    
    c_17 = np.random.randint(95, 100, count)
    c_17_max = np.max(c_17)
    c_17_min = np.min(c_17)
    data_max_min.append([c_17_max, c_17_min])
    
    c_18 = np.random.randint(80, 100, count)
    c_18_max = np.max(c_18)
    c_18_min = np.min(c_18)
    data_max_min.append([c_18_max, c_18_min])
    
    c_19 = np.random.randint(90, 100, count)
    c_19_max = np.max(c_19)
    c_19_min = np.min(c_19)
    data_max_min.append([c_19_max, c_19_min])
    
    c_20 = np.random.randint(90, 100, count)
    c_20_max = np.max(c_20)
    c_20_min = np.min(c_20)
    data_max_min.append([c_20_max, c_20_min])
    
    c_21 = np.random.randint(95, 100, count)
    c_21_max = np.max(c_21)
    c_21_min = np.min(c_21)
    data_max_min.append([c_21_max, c_21_min])
    
    c_22 = np.random.randint(90, 100, count)
    c_22_max = np.max(c_22)
    c_22_min = np.min(c_22)
    data_max_min.append([c_22_max, c_22_min])
    
    c_23 = np.random.randint(80, 100, count)
    c_23_max = np.max(c_23)
    c_23_min = np.min(c_23)
    data_max_min.append([c_23_max, c_23_min])
    
    c_24 = np.random.randint(90, 100, count)
    c_24_max = np.max(c_24)
    c_24_min = np.min(c_24)
    data_max_min.append([c_24_max, c_24_min])

    
    for i in range(count):
        data_row = []
        data_row.append(startIndex + i)
        data_row.append(float(c_1[i]))
        data_row.append(float(c_2[i]))
        data_row.append(float(c_3[i]))
        data_row.append(float(c_4[i]))
        data_row.append(float(c_5[i]))
        data_row.append(float(c_6[i]))
        data_row.append(float(c_7[i]))
        data_row.append(float(c_8[i]))
        data_row.append(float(c_9[i]))
        data_row.append(float(c_10[i]))
        data_row.append(float(c_11[i]))
        data_row.append(float(c_12[i]))
        data_row.append(float(c_13[i]))
        data_row.append(float(c_14[i]))
        data_row.append(float(c_15[i]))
        data_row.append(float(c_16[i]))
        data_row.append(float(c_17[i]))
        data_row.append(float(c_18[i]))
        data_row.append(float(c_19[i]))
        data_row.append(float(c_20[i]))
        data_row.append(float(c_21[i]))
        data_row.append(float(c_22[i]))
        data_row.append(float(c_23[i]))
        data_row.append(float(c_24[i]))
        data_row.append(5)
        data_set.append(data_row)
    return (data_set, data_max_min)


# In[23]:


def getLevelFourData(count, startIndex):
    data_set = []
    data_max_min = []
    c_1 = np.random.randint(20, 40, size=count)
    c_1_max = np.max(c_1)
    c_1_min = np.min(c_1)
    data_max_min.append([c_1_max, c_1_min])
    
    # c_2 = (np.random.randint(90, 95, size=count) / 100)
    c_2 = (np.random.rand(count) * 0.05 + 0.9)
    c_2_max = np.max(c_2)
    c_2_min = np.min(c_2)
    data_max_min.append([c_2_max, c_2_min])
    
    c_3 = np.random.randint(60, 80, count)
    c_3_max = np.max(c_3)
    c_3_min = np.min(c_3)
    data_max_min.append([c_3_max, c_3_min])
    
    c_4 = np.random.randint(4000, 5000, count)
    c_4_max = np.max(c_4)
    c_4_min = np.min(c_4)
    data_max_min.append([c_4_max, c_4_min])
    
    c_5 = np.random.randint(80, 95, count)
    c_5_max = np.max(c_5)
    c_5_min = np.min(c_5)
    data_max_min.append([c_5_max, c_5_min])
    
    c_6 = np.random.randint(80, 95, count)
    c_6_max = np.max(c_6)
    c_6_min = np.min(c_6)
    data_max_min.append([c_6_max, c_6_min])
    
    c_7 = np.random.randint(15, 20, count)
    c_7_max = np.max(c_7)
    c_7_min = np.min(c_7)
    data_max_min.append([c_7_max, c_7_min])
    
    c_8 = np.random.randint(75, 90, count)
    c_8_max = np.max(c_8)
    c_8_min = np.min(c_8)
    data_max_min.append([c_8_max, c_8_min])
    
    c_9 = np.random.randint(80, 90, count)
    c_9_max = np.max(c_9)
    c_9_min = np.min(c_9)
    data_max_min.append([c_9_max, c_9_min])
    
    c_10 = np.random.randint(2, 4, count)
    c_10_max = np.max(c_10)
    c_10_min = np.min(c_10)
    data_max_min.append([c_10_max, c_10_min])
    
    c_11 = np.random.randint(60, 80, count)
    c_11_max = np.max(c_11)
    c_11_min = np.min(c_11)
    data_max_min.append([c_11_max, c_11_min])
    
    c_12 = np.random.randint(10, 20, count)
    c_12_max = np.max(c_12)
    c_12_min = np.min(c_12)
    data_max_min.append([c_12_max, c_12_min])
    
    c_13 = np.random.randint(80, 90, count)
    c_13_max = np.max(c_13)
    c_13_min = np.min(c_13)
    data_max_min.append([c_13_max, c_13_min])
    
    c_14 = np.random.randint(20, 40, count)
    c_14_max = np.max(c_14)
    c_14_min = np.min(c_14)
    data_max_min.append([c_14_max, c_14_min])
    
    c_15 = np.random.randint(80, 90, count)
    c_15_max = np.max(c_15)
    c_15_min = np.min(c_15)
    data_max_min.append([c_15_max, c_15_min])
    
    # c_16 = np.random.randint(60, 70, size=count, dtype=np.float32)
    c_16 = (np.random.rand(count) * 0.1 + 0.6)
    c_16_max = np.max(c_16)
    c_16_min = np.min(c_16)
    data_max_min.append([c_16_max, c_16_min])
    
    c_17 = np.random.randint(80, 95, count)
    c_17_max = np.max(c_17)
    c_17_min = np.min(c_17)
    data_max_min.append([c_17_max, c_17_min])
    
    c_18 = np.random.randint(60, 80, count)
    c_18_max = np.max(c_18)
    c_18_min = np.min(c_18)
    data_max_min.append([c_18_max, c_18_min])
    
    c_19 = np.random.randint(80, 90, count)
    c_19_max = np.max(c_19)
    c_19_min = np.min(c_19)
    data_max_min.append([c_19_max, c_19_min])
    
    c_20 = np.random.randint(80, 90, count)
    c_20_max = np.max(c_20)
    c_20_min = np.min(c_20)
    data_max_min.append([c_20_max, c_20_min])
    
    c_21 = np.random.randint(85, 95, count)
    c_21_max = np.max(c_21)
    c_21_min = np.min(c_21)
    data_max_min.append([c_21_max, c_21_min])
    
    c_22 = np.random.randint(80, 90, count)
    c_22_max = np.max(c_22)
    c_22_min = np.min(c_22)
    data_max_min.append([c_22_max, c_22_min])
    
    c_23 = np.random.randint(60, 80, count)
    c_23_max = np.max(c_23)
    c_23_min = np.min(c_23)
    data_max_min.append([c_23_max, c_23_min])
    
    c_24 = np.random.randint(80, 90, count)
    c_24_max = np.max(c_24)
    c_24_min = np.min(c_24)
    data_max_min.append([c_24_max, c_24_min])

    for i in range(count):
        data_row = []
        data_row.append(startIndex + i)
        data_row.append(float(c_1[i]))
        data_row.append(float(c_2[i]))
        data_row.append(float(c_3[i]))
        data_row.append(float(c_4[i]))
        data_row.append(float(c_5[i]))
        data_row.append(float(c_6[i]))
        data_row.append(float(c_7[i]))
        data_row.append(float(c_8[i]))
        data_row.append(float(c_9[i]))
        data_row.append(float(c_10[i]))
        data_row.append(float(c_11[i]))
        data_row.append(float(c_12[i]))
        data_row.append(float(c_13[i]))
        data_row.append(float(c_14[i]))
        data_row.append(float(c_15[i]))
        data_row.append(float(c_16[i]))
        data_row.append(float(c_17[i]))
        data_row.append(float(c_18[i]))
        data_row.append(float(c_19[i]))
        data_row.append(float(c_20[i]))
        data_row.append(float(c_21[i]))
        data_row.append(float(c_22[i]))
        data_row.append(float(c_23[i]))
        data_row.append(float(c_24[i]))
        data_row.append(4)
        data_set.append(data_row)
    return (data_set, data_max_min)


# In[24]:


def getLevelThreeData(count, startIndex):
    data_set = []
    data_max_min = []
    c_1 = np.random.randint(40, 60, size=count)
    c_1_max = np.max(c_1)
    c_1_min = np.min(c_1)
    data_max_min.append([c_1_max, c_1_min])
    
    # c_2 = (np.random.randint(90, 95, size=count) / 100)
    c_2 = (np.random.rand(count) * 0.05 + 0.85)
    c_2_max = np.max(c_2)
    c_2_min = np.min(c_2)
    data_max_min.append([c_2_max, c_2_min])
    
    c_3 = np.random.randint(40, 60, count)
    c_3_max = np.max(c_3)
    c_3_min = np.min(c_3)
    data_max_min.append([c_3_max, c_3_min])
    
    c_4 = np.random.randint(3000, 4000, count)
    c_4_max = np.max(c_4)
    c_4_min = np.min(c_4)
    data_max_min.append([c_4_max, c_4_min])
    
    c_5 = np.random.randint(60, 80, count)
    c_5_max = np.max(c_5)
    c_5_min = np.min(c_5)
    data_max_min.append([c_5_max, c_5_min])
    
    c_6 = np.random.randint(60, 80, count)
    c_6_max = np.max(c_6)
    c_6_min = np.min(c_6)
    data_max_min.append([c_6_max, c_6_min])
    
    c_7 = np.random.randint(10, 15, count)
    c_7_max = np.max(c_7)
    c_7_min = np.min(c_7)
    data_max_min.append([c_7_max, c_7_min])
    
    c_8 = np.random.randint(60, 75, count)
    c_8_max = np.max(c_8)
    c_8_min = np.min(c_8)
    data_max_min.append([c_8_max, c_8_min])
    
    c_9 = np.random.randint(70, 80, count)
    c_9_max = np.max(c_9)
    c_9_min = np.min(c_9)
    data_max_min.append([c_9_max, c_9_min])
    
    c_10 = np.random.randint(4, 6, count)
    c_10_max = np.max(c_10)
    c_10_min = np.min(c_10)
    data_max_min.append([c_10_max, c_10_min])
    
    c_11 = np.random.randint(40, 60, count)
    c_11_max = np.max(c_11)
    c_11_min = np.min(c_11)
    data_max_min.append([c_11_max, c_11_min])
    
    c_12 = np.random.randint(20, 40, count)
    c_12_max = np.max(c_12)
    c_12_min = np.min(c_12)
    data_max_min.append([c_12_max, c_12_min])
    
    c_13 = np.random.randint(70, 80, count)
    c_13_max = np.max(c_13)
    c_13_min = np.min(c_13)
    data_max_min.append([c_13_max, c_13_min])
    
    c_14 = np.random.randint(40, 60, count)
    c_14_max = np.max(c_14)
    c_14_min = np.min(c_14)
    data_max_min.append([c_14_max, c_14_min])
    
    c_15 = np.random.randint(70, 80, count)
    c_15_max = np.max(c_15)
    c_15_min = np.min(c_15)
    data_max_min.append([c_15_max, c_15_min])
    
    # c_16 = np.random.randint(60, 70, size=count, dtype=np.float32)
    c_16 = (np.random.rand(count) * 0.1 + 0.5)
    c_16_max = np.max(c_16)
    c_16_min = np.min(c_16)
    data_max_min.append([c_16_max, c_16_min])
    
    c_17 = np.random.randint(60, 80, count)
    c_17_max = np.max(c_17)
    c_17_min = np.min(c_17)
    data_max_min.append([c_17_max, c_17_min])
    
    c_18 = np.random.randint(40, 60, count)
    c_18_max = np.max(c_18)
    c_18_min = np.min(c_18)
    data_max_min.append([c_18_max, c_18_min])
    
    c_19 = np.random.randint(70, 80, count)
    c_19_max = np.max(c_19)
    c_19_min = np.min(c_19)
    data_max_min.append([c_19_max, c_19_min])
    
    c_20 = np.random.randint(70, 80, count)
    c_20_max = np.max(c_20)
    c_20_min = np.min(c_20)
    data_max_min.append([c_20_max, c_20_min])
    
    c_21 = np.random.randint(70, 85, count)
    c_21_max = np.max(c_21)
    c_21_min = np.min(c_21)
    data_max_min.append([c_21_max, c_21_min])
    
    c_22 = np.random.randint(70, 80, count)
    c_22_max = np.max(c_22)
    c_22_min = np.min(c_22)
    data_max_min.append([c_22_max, c_22_min])
    
    c_23 = np.random.randint(40, 60, count)
    c_23_max = np.max(c_23)
    c_23_min = np.min(c_23)
    data_max_min.append([c_23_max, c_23_min])
    
    c_24 = np.random.randint(60, 80, count)
    c_24_max = np.max(c_24)
    c_24_min = np.min(c_24)
    data_max_min.append([c_24_max, c_24_min])

    for i in range(count):
        data_row = []
        data_row.append(startIndex + i)
        data_row.append(float(c_1[i]))
        data_row.append(float(c_2[i]))
        data_row.append(float(c_3[i]))
        data_row.append(float(c_4[i]))
        data_row.append(float(c_5[i]))
        data_row.append(float(c_6[i]))
        data_row.append(float(c_7[i]))
        data_row.append(float(c_8[i]))
        data_row.append(float(c_9[i]))
        data_row.append(float(c_10[i]))
        data_row.append(float(c_11[i]))
        data_row.append(float(c_12[i]))
        data_row.append(float(c_13[i]))
        data_row.append(float(c_14[i]))
        data_row.append(float(c_15[i]))
        data_row.append(float(c_16[i]))
        data_row.append(float(c_17[i]))
        data_row.append(float(c_18[i]))
        data_row.append(float(c_19[i]))
        data_row.append(float(c_20[i]))
        data_row.append(float(c_21[i]))
        data_row.append(float(c_22[i]))
        data_row.append(float(c_23[i]))
        data_row.append(float(c_24[i]))
        data_row.append(3)
        data_set.append(data_row)
    return (data_set, data_max_min)


# In[25]:


def getLevelTwoData(count, startIndex):
    data_set = []
    data_max_min = []
    c_1 = np.random.randint(60, 80, size=count)
    c_1_max = np.max(c_1)
    c_1_min = np.min(c_1)
    data_max_min.append([c_1_max, c_1_min])
    
    # c_2 = (np.random.randint(90, 95, size=count) / 100)
    c_2 = (np.random.rand(count) * 0.05 + 0.8)
    c_2_max = np.max(c_2)
    c_2_min = np.min(c_2)
    data_max_min.append([c_2_max, c_2_min])
    
    c_3 = np.random.randint(20, 40, count)
    c_3_max = np.max(c_3)
    c_3_min = np.min(c_3)
    data_max_min.append([c_3_max, c_3_min])
    
    c_4 = np.random.randint(2000, 3000, count)
    c_4_max = np.max(c_4)
    c_4_min = np.min(c_4)
    data_max_min.append([c_4_max, c_4_min])
    
    c_5 = np.random.randint(40, 60, count)
    c_5_max = np.max(c_5)
    c_5_min = np.min(c_5)
    data_max_min.append([c_5_max, c_5_min])
    
    c_6 = np.random.randint(40, 60, count)
    c_6_max = np.max(c_6)
    c_6_min = np.min(c_6)
    data_max_min.append([c_6_max, c_6_min])
    
    c_7 = np.random.randint(5, 10, count)
    c_7_max = np.max(c_7)
    c_7_min = np.min(c_7)
    data_max_min.append([c_7_max, c_7_min])
    
    c_8 = np.random.randint(30, 60, count)
    c_8_max = np.max(c_8)
    c_8_min = np.min(c_8)
    data_max_min.append([c_8_max, c_8_min])
    
    c_9 = np.random.randint(50, 70, count)
    c_9_max = np.max(c_9)
    c_9_min = np.min(c_9)
    data_max_min.append([c_9_max, c_9_min])
    
    c_10 = np.random.randint(6, 10, count)
    c_10_max = np.max(c_10)
    c_10_min = np.min(c_10)
    data_max_min.append([c_10_max, c_10_min])
    
    c_11 = np.random.randint(20, 40, count)
    c_11_max = np.max(c_11)
    c_11_min = np.min(c_11)
    data_max_min.append([c_11_max, c_11_min])
    
    c_12 = np.random.randint(40, 60, count)
    c_12_max = np.max(c_12)
    c_12_min = np.min(c_12)
    data_max_min.append([c_12_max, c_12_min])
    
    c_13 = np.random.randint(50, 70, count)
    c_13_max = np.max(c_13)
    c_13_min = np.min(c_13)
    data_max_min.append([c_13_max, c_13_min])
    
    c_14 = np.random.randint(60, 80, count)
    c_14_max = np.max(c_14)
    c_14_min = np.min(c_14)
    data_max_min.append([c_14_max, c_14_min])
    
    c_15 = np.random.randint(50, 70, count)
    c_15_max = np.max(c_15)
    c_15_min = np.min(c_15)
    data_max_min.append([c_15_max, c_15_min])
    
    # c_16 = np.random.randint(60, 70, size=count, dtype=np.float32)
    c_16 = (np.random.rand(count) * 0.1 + 0.4)
    c_16_max = np.max(c_16)
    c_16_min = np.min(c_16)
    data_max_min.append([c_16_max, c_16_min])
    
    c_17 = np.random.randint(40, 60, count)
    c_17_max = np.max(c_17)
    c_17_min = np.min(c_17)
    data_max_min.append([c_17_max, c_17_min])
    
    c_18 = np.random.randint(20, 40, count)
    c_18_max = np.max(c_18)
    c_18_min = np.min(c_18)
    data_max_min.append([c_18_max, c_18_min])
    
    c_19 = np.random.randint(40, 70, count)
    c_19_max = np.max(c_19)
    c_19_min = np.min(c_19)
    data_max_min.append([c_19_max, c_19_min])
    
    c_20 = np.random.randint(40, 70, count)
    c_20_max = np.max(c_20)
    c_20_min = np.min(c_20)
    data_max_min.append([c_20_max, c_20_min])
    
    c_21 = np.random.randint(40, 70, count)
    c_21_max = np.max(c_21)
    c_21_min = np.min(c_21)
    data_max_min.append([c_21_max, c_21_min])
    
    c_22 = np.random.randint(50, 70, count)
    c_22_max = np.max(c_22)
    c_22_min = np.min(c_22)
    data_max_min.append([c_22_max, c_22_min])
    
    c_23 = np.random.randint(20, 40, count)
    c_23_max = np.max(c_23)
    c_23_min = np.min(c_23)
    data_max_min.append([c_23_max, c_23_min])
    
    c_24 = np.random.randint(30, 60, count)
    c_24_max = np.max(c_24)
    c_24_min = np.min(c_24)
    data_max_min.append([c_24_max, c_24_min])

    for i in range(count):
        data_row = []
        data_row.append(startIndex + i)
        data_row.append(float(c_1[i]))
        data_row.append(float(c_2[i]))
        data_row.append(float(c_3[i]))
        data_row.append(float(c_4[i]))
        data_row.append(float(c_5[i]))
        data_row.append(float(c_6[i]))
        data_row.append(float(c_7[i]))
        data_row.append(float(c_8[i]))
        data_row.append(float(c_9[i]))
        data_row.append(float(c_10[i]))
        data_row.append(float(c_11[i]))
        data_row.append(float(c_12[i]))
        data_row.append(float(c_13[i]))
        data_row.append(float(c_14[i]))
        data_row.append(float(c_15[i]))
        data_row.append(float(c_16[i]))
        data_row.append(float(c_17[i]))
        data_row.append(float(c_18[i]))
        data_row.append(float(c_19[i]))
        data_row.append(float(c_20[i]))
        data_row.append(float(c_21[i]))
        data_row.append(float(c_22[i]))
        data_row.append(float(c_23[i]))
        data_row.append(float(c_24[i]))
        data_row.append(2)
        data_set.append(data_row)
    return (data_set, data_max_min)


# In[26]:


def getLevelOneData(count, startIndex):
    data_set = []
    data_max_min = []
    c_1 = np.random.randint(low=80, size=count)
    c_1_max = np.max(c_1)
    c_1_min = np.min(c_1)
    data_max_min.append([c_1_max, c_1_min])
    
    # c_2 = (np.random.randint(90, 95, size=count) / 100)
    c_2 = (np.random.rand(count) * 0.8)
    c_2_max = np.max(c_2)
    c_2_min = np.min(c_2)
    data_max_min.append([c_2_max, c_2_min])
    
    c_3 = np.random.randint(0, 20, count)
    c_3_max = np.max(c_3)
    c_3_min = np.min(c_3)
    data_max_min.append([c_3_max, c_3_min])
    
    c_4 = np.random.randint(0, 2000, count)
    c_4_max = np.max(c_4)
    c_4_min = np.min(c_4)
    data_max_min.append([c_4_max, c_4_min])
    
    c_5 = np.random.randint(0, 40, count)
    c_5_max = np.max(c_5)
    c_5_min = np.min(c_5)
    data_max_min.append([c_5_max, c_5_min])
    
    c_6 = np.random.randint(0, 40, count)
    c_6_max = np.max(c_6)
    c_6_min = np.min(c_6)
    data_max_min.append([c_6_max, c_6_min])
    
    c_7 = np.random.randint(0, 5, count)
    c_7_max = np.max(c_7)
    c_7_min = np.min(c_7)
    data_max_min.append([c_7_max, c_7_min])
    
    c_8 = np.random.randint(0, 30, count)
    c_8_max = np.max(c_8)
    c_8_min = np.min(c_8)
    data_max_min.append([c_8_max, c_8_min])
    
    c_9 = np.random.randint(0, 50, count)
    c_9_max = np.max(c_9)
    c_9_min = np.min(c_9)
    data_max_min.append([c_9_max, c_9_min])
    
    c_10 = np.random.randint(low=10, size=count)
    c_10_max = np.max(c_10)
    c_10_min = np.min(c_10)
    data_max_min.append([c_10_max, c_10_min])
    
    c_11 = np.random.randint(0, 20, count)
    c_11_max = np.max(c_11)
    c_11_min = np.min(c_11)
    data_max_min.append([c_11_max, c_11_min])
    
    c_12 = np.random.randint(low=60, size=count)
    c_12_max = np.max(c_12)
    c_12_min = np.min(c_12)
    data_max_min.append([c_12_max, c_12_min])
    
    c_13 = np.random.randint(0, 50, count)
    c_13_max = np.max(c_13)
    c_13_min = np.min(c_13)
    data_max_min.append([c_13_max, c_13_min])
    
    c_14 = np.random.randint(low=80, size=count)
    c_14_max = np.max(c_14)
    c_14_min = np.min(c_14)
    data_max_min.append([c_14_max, c_14_min])
    
    c_15 = np.random.randint(0, 50, count)
    c_15_max = np.max(c_15)
    c_15_min = np.min(c_15)
    data_max_min.append([c_15_max, c_15_min])
    
    # c_16 = np.random.randint(60, 70, size=count, dtype=np.float32)
    c_16 = (np.random.rand(count) * 0.4)
    c_16_max = np.max(c_16)
    c_16_min = np.min(c_16)
    data_max_min.append([c_16_max, c_16_min])
    
    c_17 = np.random.randint(0, 40, count)
    c_17_max = np.max(c_17)
    c_17_min = np.min(c_17)
    data_max_min.append([c_17_max, c_17_min])
    
    c_18 = np.random.randint(0, 20, count)
    c_18_max = np.max(c_18)
    c_18_min = np.min(c_18)
    data_max_min.append([c_18_max, c_18_min])
    
    c_19 = np.random.randint(0, 40, count)
    c_19_max = np.max(c_19)
    c_19_min = np.min(c_19)
    data_max_min.append([c_19_max, c_19_min])
    
    c_20 = np.random.randint(0, 40, count)
    c_20_max = np.max(c_20)
    c_20_min = np.min(c_20)
    data_max_min.append([c_20_max, c_20_min])
    
    c_21 = np.random.randint(0, 40, count)
    c_21_max = np.max(c_21)
    c_21_min = np.min(c_21)
    data_max_min.append([c_21_max, c_21_min])
    
    c_22 = np.random.randint(0, 50, count)
    c_22_max = np.max(c_22)
    c_22_min = np.min(c_22)
    data_max_min.append([c_22_max, c_22_min])
    
    c_23 = np.random.randint(0, 20, count)
    c_23_max = np.max(c_23)
    c_23_min = np.min(c_23)
    data_max_min.append([c_23_max, c_23_min])
    
    c_24 = np.random.randint(0, 30, count)
    c_24_max = np.max(c_24)
    c_24_min = np.min(c_24)
    data_max_min.append([c_24_max, c_24_min])

    for i in range(count):
        data_row = []
        data_row.append(startIndex + i)
        data_row.append(float(c_1[i]))
        data_row.append(float(c_2[i]))
        data_row.append(float(c_3[i]))
        data_row.append(float(c_4[i]))
        data_row.append(float(c_5[i]))
        data_row.append(float(c_6[i]))
        data_row.append(float(c_7[i]))
        data_row.append(float(c_8[i]))
        data_row.append(float(c_9[i]))
        data_row.append(float(c_10[i]))
        data_row.append(float(c_11[i]))
        data_row.append(float(c_12[i]))
        data_row.append(float(c_13[i]))
        data_row.append(float(c_14[i]))
        data_row.append(float(c_15[i]))
        data_row.append(float(c_16[i]))
        data_row.append(float(c_17[i]))
        data_row.append(float(c_18[i]))
        data_row.append(float(c_19[i]))
        data_row.append(float(c_20[i]))
        data_row.append(float(c_21[i]))
        data_row.append(float(c_22[i]))
        data_row.append(float(c_23[i]))
        data_row.append(float(c_24[i]))
        data_row.append(1)
        data_set.append(data_row)
    return (data_set, data_max_min)


# In[27]:


data_five, data_max_min_five = getLevelFiveData(100, 1)


# In[28]:


data_four, data_max_min_four = getLevelFourData(100, 101)


# In[29]:


data_three, data_max_min_three = getLevelThreeData(100, 201)


# In[30]:


data_two, data_max_min_two = getLevelTwoData(100, 301)


# In[31]:


data_one, data_max_min_one = getLevelOneData(100, 401)


# In[32]:


c_1_max = 800.0
c_1_min = 2.0

c_2_max = 9.5
c_2_min = 0.08

c_3_max = 800.0
c_3_min = 0.2

c_4_max = 50000.0
c_4_min = 200.0

c_5_max = 950.0
c_5_min = 4.0

c_6_max = 950.0
c_6_min = 4.0

c_7_max = 200.0
c_7_min = 0.5

c_8_max = 900.0
c_8_min = 3.0

c_9_max = 900.0
c_9_min = 5.0

c_10_max = 100.0
c_10_min = 0.2

c_11_max = 800.0
c_11_min = 2.0

c_12_max = 600.0
c_12_min = 1.0

c_13_max = 900.0
c_13_min = 5.0

c_14_max = 800.0
c_14_min = 2.0

c_15_max = 900.0
c_15_min = 5.0

c_16_max = 7.0
c_16_min = 0.04

c_17_max = 950.0
c_17_min = 4.0

c_18_max = 800.0
c_18_min = 2.0

c_19_max = 900.0
c_19_min = 4.0

c_20_max = 900.0
c_20_min = 4.0

c_21_max = 950.0
c_21_min = 4.0

c_22_max = 900.0
c_22_min = 5.0

c_23_max = 800.0
c_23_min = 2.0

c_24_max = 900.0
c_24_min = 3.0

data_all = []
for item in data_five:
    data_row = [] 
    data_row.append(item[0])
    data_row.append((c_1_max - item[1])/(c_1_max - c_1_min)) # 负向
    data_row.append((item[2] - c_2_min)/(c_2_max - c_2_min)) # 正向
    data_row.append((item[3] - c_3_min)/(c_3_max - c_3_min))
    data_row.append((item[4] - c_4_min)/(c_4_max - c_4_min))
    data_row.append((item[5] - c_5_min)/(c_5_max - c_5_min))
    data_row.append((item[6] - c_6_min)/(c_6_max - c_6_min))
    data_row.append((item[7] - c_7_min)/(c_7_max - c_7_min))
    data_row.append((item[8] - c_8_min)/(c_8_max - c_8_min))
    data_row.append((item[9] - c_9_min)/(c_9_max - c_9_min))
    data_row.append((c_10_max - item[10])/(c_10_max - c_10_min))
    data_row.append((item[11] - c_11_min)/(c_11_max - c_11_min))
    data_row.append((c_12_max - item[12])/(c_12_max - c_12_min))
    data_row.append((item[13] - c_13_min)/(c_13_max - c_13_min))
    data_row.append((c_14_max - item[14])/(c_14_max - c_14_min))
    data_row.append((item[15] - c_15_min)/(c_15_max - c_15_min))
    data_row.append((item[16] - c_16_min)/(c_16_max - c_16_min))
    data_row.append((item[17] - c_17_min)/(c_17_max - c_17_min))
    data_row.append((item[18] - c_18_min)/(c_18_max - c_18_min))
    data_row.append((item[19] - c_19_min)/(c_19_max - c_19_min))
    data_row.append((item[20] - c_20_min)/(c_20_max - c_20_min))
    data_row.append((item[21] - c_21_min)/(c_21_max - c_21_min))
    data_row.append((item[22] - c_22_min)/(c_22_max - c_22_min))
    data_row.append((item[23] - c_23_min)/(c_23_max - c_23_min))
    data_row.append((item[24] - c_24_min)/(c_24_max - c_24_min))
    data_row.append(item[25])
    data_all.append(data_row)
    
for item in data_four:
    data_row = []
    data_row.append(item[0])
    data_row.append((c_1_max - item[1])/(c_1_max - c_1_min)) # 负向
    data_row.append((item[2] - c_2_min)/(c_2_max - c_2_min)) # 正向
    data_row.append((item[3] - c_3_min)/(c_3_max - c_3_min))
    data_row.append((item[4] - c_4_min)/(c_4_max - c_4_min))
    data_row.append((item[5] - c_5_min)/(c_5_max - c_5_min))
    data_row.append((item[6] - c_6_min)/(c_6_max - c_6_min))
    data_row.append((item[7] - c_7_min)/(c_7_max - c_7_min))
    data_row.append((item[8] - c_8_min)/(c_8_max - c_8_min))
    data_row.append((item[9] - c_9_min)/(c_9_max - c_9_min))
    data_row.append((c_10_max - item[10])/(c_10_max - c_10_min))
    data_row.append((item[11] - c_11_min)/(c_11_max - c_11_min))
    data_row.append((c_12_max - item[12])/(c_12_max - c_12_min))
    data_row.append((item[13] - c_13_min)/(c_13_max - c_13_min))
    data_row.append((c_14_max - item[14])/(c_14_max - c_14_min))
    data_row.append((item[15] - c_15_min)/(c_15_max - c_15_min))
    data_row.append((item[16] - c_16_min)/(c_16_max - c_16_min))
    data_row.append((item[17] - c_17_min)/(c_17_max - c_17_min))
    data_row.append((item[18] - c_18_min)/(c_18_max - c_18_min))
    data_row.append((item[19] - c_19_min)/(c_19_max - c_19_min))
    data_row.append((item[20] - c_20_min)/(c_20_max - c_20_min))
    data_row.append((item[21] - c_21_min)/(c_21_max - c_21_min))
    data_row.append((item[22] - c_22_min)/(c_22_max - c_22_min))
    data_row.append((item[23] - c_23_min)/(c_23_max - c_23_min))
    data_row.append((item[24] - c_24_min)/(c_24_max - c_24_min))
    data_row.append(item[25])
    data_all.append(data_row)
    
for item in data_three:
    data_row = []
    data_row.append(item[0])
    data_row.append((c_1_max - item[1])/(c_1_max - c_1_min)) # 负向
    data_row.append((item[2] - c_2_min)/(c_2_max - c_2_min)) # 正向
    data_row.append((item[3] - c_3_min)/(c_3_max - c_3_min))
    data_row.append((item[4] - c_4_min)/(c_4_max - c_4_min))
    data_row.append((item[5] - c_5_min)/(c_5_max - c_5_min))
    data_row.append((item[6] - c_6_min)/(c_6_max - c_6_min))
    data_row.append((item[7] - c_7_min)/(c_7_max - c_7_min))
    data_row.append((item[8] - c_8_min)/(c_8_max - c_8_min))
    data_row.append((item[9] - c_9_min)/(c_9_max - c_9_min))
    data_row.append((c_10_max - item[10])/(c_10_max - c_10_min))
    data_row.append((item[11] - c_11_min)/(c_11_max - c_11_min))
    data_row.append((c_12_max - item[12])/(c_12_max - c_12_min))
    data_row.append((item[13] - c_13_min)/(c_13_max - c_13_min))
    data_row.append((c_14_max - item[14])/(c_14_max - c_14_min))
    data_row.append((item[15] - c_15_min)/(c_15_max - c_15_min))
    data_row.append((item[16] - c_16_min)/(c_16_max - c_16_min))
    data_row.append((item[17] - c_17_min)/(c_17_max - c_17_min))
    data_row.append((item[18] - c_18_min)/(c_18_max - c_18_min))
    data_row.append((item[19] - c_19_min)/(c_19_max - c_19_min))
    data_row.append((item[20] - c_20_min)/(c_20_max - c_20_min))
    data_row.append((item[21] - c_21_min)/(c_21_max - c_21_min))
    data_row.append((item[22] - c_22_min)/(c_22_max - c_22_min))
    data_row.append((item[23] - c_23_min)/(c_23_max - c_23_min))
    data_row.append((item[24] - c_24_min)/(c_24_max - c_24_min))
    data_row.append(item[25])
    data_all.append(data_row)
    
for item in data_two:
    data_row = []
    data_row.append(item[0])
    data_row.append((c_1_max - item[1])/(c_1_max - c_1_min)) # 负向
    data_row.append((item[2] - c_2_min)/(c_2_max - c_2_min)) # 正向
    data_row.append((item[3] - c_3_min)/(c_3_max - c_3_min))
    data_row.append((item[4] - c_4_min)/(c_4_max - c_4_min))
    data_row.append((item[5] - c_5_min)/(c_5_max - c_5_min))
    data_row.append((item[6] - c_6_min)/(c_6_max - c_6_min))
    data_row.append((item[7] - c_7_min)/(c_7_max - c_7_min))
    data_row.append((item[8] - c_8_min)/(c_8_max - c_8_min))
    data_row.append((item[9] - c_9_min)/(c_9_max - c_9_min))
    data_row.append((c_10_max - item[10])/(c_10_max - c_10_min))
    data_row.append((item[11] - c_11_min)/(c_11_max - c_11_min))
    data_row.append((c_12_max - item[12])/(c_12_max - c_12_min))
    data_row.append((item[13] - c_13_min)/(c_13_max - c_13_min))
    data_row.append((c_14_max - item[14])/(c_14_max - c_14_min))
    data_row.append((item[15] - c_15_min)/(c_15_max - c_15_min))
    data_row.append((item[16] - c_16_min)/(c_16_max - c_16_min))
    data_row.append((item[17] - c_17_min)/(c_17_max - c_17_min))
    data_row.append((item[18] - c_18_min)/(c_18_max - c_18_min))
    data_row.append((item[19] - c_19_min)/(c_19_max - c_19_min))
    data_row.append((item[20] - c_20_min)/(c_20_max - c_20_min))
    data_row.append((item[21] - c_21_min)/(c_21_max - c_21_min))
    data_row.append((item[22] - c_22_min)/(c_22_max - c_22_min))
    data_row.append((item[23] - c_23_min)/(c_23_max - c_23_min))
    data_row.append((item[24] - c_24_min)/(c_24_max - c_24_min))
    data_row.append(item[25])
    data_all.append(data_row)
    
for item in data_one:
    data_row = []
    data_row.append(item[0])
    data_row.append((c_1_max - item[1])/(c_1_max - c_1_min)) # 负向
    data_row.append((item[2] - c_2_min)/(c_2_max - c_2_min)) # 正向
    data_row.append((item[3] - c_3_min)/(c_3_max - c_3_min))
    data_row.append((item[4] - c_4_min)/(c_4_max - c_4_min))
    data_row.append((item[5] - c_5_min)/(c_5_max - c_5_min))
    data_row.append((item[6] - c_6_min)/(c_6_max - c_6_min))
    data_row.append((item[7] - c_7_min)/(c_7_max - c_7_min))
    data_row.append((item[8] - c_8_min)/(c_8_max - c_8_min))
    data_row.append((item[9] - c_9_min)/(c_9_max - c_9_min))
    data_row.append((c_10_max - item[10])/(c_10_max - c_10_min))
    data_row.append((item[11] - c_11_min)/(c_11_max - c_11_min))
    data_row.append((c_12_max - item[12])/(c_12_max - c_12_min))
    data_row.append((item[13] - c_13_min)/(c_13_max - c_13_min))
    data_row.append((c_14_max - item[14])/(c_14_max - c_14_min))
    data_row.append((item[15] - c_15_min)/(c_15_max - c_15_min))
    data_row.append((item[16] - c_16_min)/(c_16_max - c_16_min))
    data_row.append((item[17] - c_17_min)/(c_17_max - c_17_min))
    data_row.append((item[18] - c_18_min)/(c_18_max - c_18_min))
    data_row.append((item[19] - c_19_min)/(c_19_max - c_19_min))
    data_row.append((item[20] - c_20_min)/(c_20_max - c_20_min))
    data_row.append((item[21] - c_21_min)/(c_21_max - c_21_min))
    data_row.append((item[22] - c_22_min)/(c_22_max - c_22_min))
    data_row.append((item[23] - c_23_min)/(c_23_max - c_23_min))
    data_row.append((item[24] - c_24_min)/(c_24_max - c_24_min))
    data_row.append(item[25])
    data_all.append(data_row)


# In[33]:


column_names = ['index', 'c_1', 'c_2', 'c_3', 'c_4', 'c_5', 'c_6', 'c_7', 'c_8', 'c_9', 'c_10', 'c_11', 'c_12', 'c_13', 'c_14', 'c_15', 'c_16', 'c_17', 'c_18', 'c_19', 'c_20', 'c_21', 'c_22', 'c_23', 'c_24', 'level']
df = pd.DataFrame(data_all, columns=column_names)


# In[34]:


df.info()


# In[36]:


df.head()


# In[37]:


df.sample()


# In[38]:


from collections import Counter

print('level', Counter(df['level']))


# In[39]:


y = df['level']
X = df.iloc[:, 1:-1]


# In[46]:


from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=123)


# In[56]:


# 交叉网格搜索
from sklearn.model_selection import GridSearchCV, cross_val_score

param_grid = {
    'criterion': ['entropy','gini'],
    'n_estimators': [100, 200, 400, 800, 1200],
    'max_features': ['sqrt'],
    'max_depth': [4,5,6,7,8],
    'min_samples_split': [4, 8, 12, 16, 20, 24, 28] }

param_grid_rfr = {
    'criterion': ['mse','mae'],
    'n_estimators': [100, 200, 400, 800, 1200],
    'max_features': ['sqrt'],
    'max_depth': [4,5,6,7,8],
    'min_samples_split': [4, 8, 12, 16, 20, 24, 28] }


# In[48]:


import sklearn.ensemble as ensemble


# In[57]:


rfc = ensemble.RandomForestClassifier()

rfr = ensemble.RandomForestRegressor()

rfr_cv = GridSearchCV(estimator=rfr, param_grid=param_grid_rfr, scoring='r2', cv=5)

rfc_cv = GridSearchCV(estimator=rfc, param_grid=param_grid, cv=4)

rfr_cv.fit(X_train, y_train)


# In[75]:


rfr_cv.best_params_


# In[74]:


rfr_cv.best_score_


# In[63]:


from sklearn.metrics import r2_score, mean_squared_error

rfr_predict = rfr_cv.predict(X_test)
rfr_predict_probe = rfr_cv.predict_proba(X_test)
print("随机森林回归的默认评估值为：", rfr_cv.score(X_test, y_test))
print("随机森林回归的R_squared值为：", r2_score(y_test, rfr_predict))


# In[73]:


data_2015 = [7.0, 0.964, 51, 4781, 80, 75, 5, 50, 60, 4.5, 80, 30, 100, 60, 80, 0.52, 80, 70, 60, 50, 85, 70, 40, 50]
data_2015_2 = []
data_2015_2.append((c_1_max - data_2015[0])/(c_1_max - c_1_min)) # 负向
data_2015_2.append((data_2015[1] - c_2_min)/(c_2_max - c_2_min)) # 正向
data_2015_2.append((data_2015[2] - c_3_min)/(c_3_max - c_3_min))
data_2015_2.append((data_2015[3] - c_4_min)/(c_4_max - c_4_min))
data_2015_2.append((data_2015[4] - c_5_min)/(c_5_max - c_5_min))
data_2015_2.append((data_2015[5] - c_6_min)/(c_6_max - c_6_min))
data_2015_2.append((data_2015[6] - c_7_min)/(c_7_max - c_7_min))
data_2015_2.append((data_2015[7] - c_8_min)/(c_8_max - c_8_min))
data_2015_2.append((data_2015[8] - c_9_min)/(c_9_max - c_9_min))
data_2015_2.append((c_10_max - data_2015[9])/(c_10_max - c_10_min))
data_2015_2.append((data_2015[10] - c_11_min)/(c_11_max - c_11_min))
data_2015_2.append((c_12_max - data_2015[11])/(c_12_max - c_12_min))
data_2015_2.append((data_2015[12] - c_13_min)/(c_13_max - c_13_min))
data_2015_2.append((c_14_max - data_2015[13])/(c_14_max - c_14_min))
data_2015_2.append((data_2015[14] - c_15_min)/(c_15_max - c_15_min))
data_2015_2.append((data_2015[15] - c_16_min)/(c_16_max - c_16_min))
data_2015_2.append((data_2015[16] - c_17_min)/(c_17_max - c_17_min))
data_2015_2.append((data_2015[17] - c_18_min)/(c_18_max - c_18_min))
data_2015_2.append((data_2015[18] - c_19_min)/(c_19_max - c_19_min))
data_2015_2.append((data_2015[19] - c_20_min)/(c_20_max - c_20_min))
data_2015_2.append((data_2015[20] - c_21_min)/(c_21_max - c_21_min))
data_2015_2.append((data_2015[21] - c_22_min)/(c_22_max - c_22_min))
data_2015_2.append((data_2015[22] - c_23_min)/(c_23_max - c_23_min))
data_2015_2.append((data_2015[23] - c_24_min)/(c_24_max - c_24_min))

data_2020 = [8.1, 0.946, 49, 4275, 90, 80, 8, 75, 80, 4.8, 85, 35, 100, 42, 95, 0.60, 90, 80, 80, 80, 90, 80, 70, 80]
data_2020_2 = []
data_2020_2.append((c_1_max - data_2020[0])/(c_1_max - c_1_min)) # 负向
data_2020_2.append((data_2020[1] - c_2_min)/(c_2_max - c_2_min)) # 正向
data_2020_2.append((data_2020[2] - c_3_min)/(c_3_max - c_3_min))
data_2020_2.append((data_2020[3] - c_4_min)/(c_4_max - c_4_min))
data_2020_2.append((data_2020[4] - c_5_min)/(c_5_max - c_5_min))
data_2020_2.append((data_2020[5] - c_6_min)/(c_6_max - c_6_min))
data_2020_2.append((data_2020[6] - c_7_min)/(c_7_max - c_7_min))
data_2020_2.append((data_2020[7] - c_8_min)/(c_8_max - c_8_min))
data_2020_2.append((data_2020[8] - c_9_min)/(c_9_max - c_9_min))
data_2020_2.append((c_10_max - data_2020[9])/(c_10_max - c_10_min))
data_2020_2.append((data_2020[10] - c_11_min)/(c_11_max - c_11_min))
data_2020_2.append((c_12_max - data_2020[11])/(c_12_max - c_12_min))
data_2020_2.append((data_2020[12] - c_13_min)/(c_13_max - c_13_min))
data_2020_2.append((c_14_max - data_2020[13])/(c_14_max - c_14_min))
data_2020_2.append((data_2020[14] - c_15_min)/(c_15_max - c_15_min))
data_2020_2.append((data_2020[15] - c_16_min)/(c_16_max - c_16_min))
data_2020_2.append((data_2020[16] - c_17_min)/(c_17_max - c_17_min))
data_2020_2.append((data_2020[17] - c_18_min)/(c_18_max - c_18_min))
data_2020_2.append((data_2020[18] - c_19_min)/(c_19_max - c_19_min))
data_2020_2.append((data_2020[19] - c_20_min)/(c_20_max - c_20_min))
data_2020_2.append((data_2020[20] - c_21_min)/(c_21_max - c_21_min))
data_2020_2.append((data_2020[21] - c_22_min)/(c_22_max - c_22_min))
data_2020_2.append((data_2020[22] - c_23_min)/(c_23_max - c_23_min))
data_2020_2.append((data_2020[23] - c_24_min)/(c_24_max - c_24_min))

data_2030 = [8.5, 0.913, 47, 4068, 100, 95, 10, 85, 95, 5.5, 90, 40, 100, 30, 100, 0.70, 95, 90, 95, 95, 95, 95, 90, 95]
data_2030_2 = []
data_2030_2.append((c_1_max - data_2030[0])/(c_1_max - c_1_min)) # 负向
data_2030_2.append((data_2030[1] - c_2_min)/(c_2_max - c_2_min)) # 正向
data_2030_2.append((data_2030[2] - c_3_min)/(c_3_max - c_3_min))
data_2030_2.append((data_2030[3] - c_4_min)/(c_4_max - c_4_min))
data_2030_2.append((data_2030[4] - c_5_min)/(c_5_max - c_5_min))
data_2030_2.append((data_2030[5] - c_6_min)/(c_6_max - c_6_min))
data_2030_2.append((data_2030[6] - c_7_min)/(c_7_max - c_7_min))
data_2030_2.append((data_2030[7] - c_8_min)/(c_8_max - c_8_min))
data_2030_2.append((data_2030[8] - c_9_min)/(c_9_max - c_9_min))
data_2030_2.append((c_10_max - data_2030[9])/(c_10_max - c_10_min))
data_2030_2.append((data_2030[10] - c_11_min)/(c_11_max - c_11_min))
data_2030_2.append((c_12_max - data_2030[11])/(c_12_max - c_12_min))
data_2030_2.append((data_2030[12] - c_13_min)/(c_13_max - c_13_min))
data_2030_2.append((c_14_max - data_2030[13])/(c_14_max - c_14_min))
data_2030_2.append((data_2030[14] - c_15_min)/(c_15_max - c_15_min))
data_2030_2.append((data_2030[15] - c_16_min)/(c_16_max - c_16_min))
data_2030_2.append((data_2030[16] - c_17_min)/(c_17_max - c_17_min))
data_2030_2.append((data_2030[17] - c_18_min)/(c_18_max - c_18_min))
data_2030_2.append((data_2030[18] - c_19_min)/(c_19_max - c_19_min))
data_2030_2.append((data_2030[19] - c_20_min)/(c_20_max - c_20_min))
data_2030_2.append((data_2030[20] - c_21_min)/(c_21_max - c_21_min))
data_2030_2.append((data_2030[21] - c_22_min)/(c_22_max - c_22_min))
data_2030_2.append((data_2030[22] - c_23_min)/(c_23_max - c_23_min))
data_2030_2.append((data_2030[23] - c_24_min)/(c_24_max - c_24_min))

print(rfr_cv.predict([data_2015_2]))
print(rfr_cv.predict([data_2020_2]))
print(rfr_cv.predict([data_2030_2]))


# In[65]:


print(rfr_cv.predict(X_test))


# In[71]:





# In[ ]:




